package city.spring.modules.material.repository;

import city.spring.modules.material.entity.MaterialInventoryEntity;
import city.spring.modules.material.vo.MaterialinventoryVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 存储库：库存盘点
 *
 * @author 谢金婷
 * @date 2020-06-11 17:29:42
 */
@Repository
public interface MaterialInventoryRepository extends BaseMapper<MaterialInventoryEntity> {

    /**
     * 查询所有盘点记录,根据创建时间排序
     *
     * @param page
     * @return
     */
    IPage<MaterialInventoryEntity> getInventoryOrder(IPage<MaterialInventoryEntity> page, @Param(Constants.WRAPPER) Wrapper<MaterialInventoryEntity> wrapper);

    /**
     * 获取一个物资盘点记录
     *
     * @param id 主键ID
     * @return
     */
    MaterialInventoryEntity getById(String id);

    IPage<MaterialinventoryVO> listPage(Page<? extends MaterialInventoryEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends MaterialInventoryEntity> wrapper);
}